<style>
    .el-select, .el-input, .el-textarea {
        width: 100%;
    }
</style>
<div class="pd14 vany_authority">
    <div class="vany_treeTable pd14" id="jurisdiction">
        <!--面包屑-->
        <div class="pb10" id="crumbs">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">系统综合管理</el-breadcrumb-item>
                <el-breadcrumb-item>用户信息</el-breadcrumb-item>
            </el-breadcrumb>
            <i-favorite></i-favorite>
        </div>
        <div id="userPage">
            <div class="pd14">
                <el-form ref="page.condition" v-model="page.condition" :inline="true" label-width="120px">
                    <el-row :gutter="8">
                        <el-col :span="6">
                            <el-form-item th:label="#{common.date}+'：'">
                                <el-date-picker
                                        v-model="notifyDateArray"
                                        type="daterange"
                                        placeholder="选择日期范围">
                                    <!--align="right"-->
                                    <!--:picker-options="pickerOptions"-->
                                </el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item th:label="#{common.is-enable}+'：'">
                                <template>
                                    <el-radio class="radio" v-model="condition.isEnable" label="1" th:text="#{common.true}">是</el-radio>
                                    <el-radio class="radio" v-model="condition.isEnable" label="0" th:text="#{common.false}">否</el-radio>
                                </template>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6" :offset="6">
                            <el-form-item>
                                <el-button type="primary" @click="search" th:text="#{common.search}">查询</el-button>
                                <el-button @click="add" th:text="#{common.add}" authority="sys_notify_add">新增</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>
            </div>

            <el-table ref="table" :data="page.records" highlight-current-row :height="tableHeight" @selection-change="handleSelectionChange">
                <!--<el-table-column type="selection"></el-table-column>-->
                <el-table-column label="" prop="id" authority="sys_notify_edit">
                    <template scope="scope">
                        <img src="templates/img/edit.png" @click="edit(scope.row)"/>
                    </template>
                </el-table-column>
                <el-table-column type="index" width="100px" show-overflow-tooltip th:label="#{common.index}"></el-table-column>
                <el-table-column prop="notifyDate" show-overflow-tooltip th:label="#{common.date}"></el-table-column>
                <el-table-column prop="expiryDate" show-overflow-tooltip th:label="#{notify.expiry-date}"></el-table-column>
                <el-table-column prop="content" show-overflow-tooltip th:label="#{notify.content}"></el-table-column>
                <el-table-column column-key="isEnable" show-overflow-tooltip th:label="#{common.is-enable}">
                    <template scope="scope">
                        <div v-if="scope.row.isEnable === '1'" th:text="#{common.true}">Y</div>
                        <div v-else style="color:#ff0000;" th:text="#{common.false}"></div>
                    </template>
                </el-table-column>
            </el-table>
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="page.current"
                    :page-sizes="[10, 20, 30]"
                    :page-size="page.size"
                    :total="page.total"
                    layout="total, sizes, prev, pager, next, jumper">
            </el-pagination>
        </div>
    </div>
</div>

<div id="addNotify">
    <el-dialog v-model="notifyFormVisible" th::title="'isEdit ?\''+#{notify.edit-notify}+'\':\''+#{notify.add-notify}+'\''" :close-on-click-modal="false" size="small"
               custom-class="border_dialog title_dialog" @close="resetForm('notifyForm')">
        <el-form :label-position="labelPosition" :model="notifyForm" :rules="rules" ref="notifyForm" label-width="100px">
            <el-row :gutter="20">
                <el-col :span="12">
                    <el-form-item th:label="#{notify.expiry-date}" required prop="expiryDate">
                        <el-date-picker v-model="expiryDate" type="date" placeholder="请选择失效日期">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item th:label="#{common.is-enable}" prop="isEnable">
                        <el-radio-group v-model="notifyForm.isEnable">
                            <el-radio :label="'1'" th:text="#{common.true}">启用</el-radio>
                            <el-radio :label="'0'" th:text="#{common.false}">禁用</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="20">
                <el-col :span="24">
                    <el-form-item th:label="#{notify.content}" prop="content">
                        <el-input type="textarea" placeholder="请输入公告内容" v-model="notifyForm.content"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button class="loading" type="primary" @click="submitForm('notifyForm', $event)" v-if="isEdit" th:text="#{common.ok}">修改</el-button>
            <el-button class="loading" type="primary" @click="submitForm('notifyForm', $event)" v-else th:text="#{common.ok}">确定</el-button>
            <el-button class="el-button--ddd" @click="hide" th:text="#{common.cancel}">取消</el-button>
        </div>
    </el-dialog>
</div>
<script type="text/javascript" src="templates/sys/js/notify.js"></script>
